<?php
namespace Framework\DiServices;

use Phalcon\Cache\Frontend\Data;

class ModelsCache extends \Phalcon\Cache\Backend\Redis
{
    public function __construct($redisConfig)
    {
        $frontCache = new Data(['lifetime' => 604800]);

        parent::__construct(
            $frontCache,
            [
                "host" => $redisConfig['host'],
                "port" => $redisConfig['port'],
                "auth" => $redisConfig['password'],
                "persistent" => false,
                "index" => 0,
            ]
        );
    }
}
